Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Commit 1418bb80f70ab6861af9f05af6ed213196b85067


Parents : ed3cc42
Author : Sudo-Ivan <ivan@quad4.io>
Signature : Signature validation error
Date : 2026-01-03T18:30:55-06:00

refactor(manifest): restructure backend integrity manifest to include metadata and adjust file verification logic

Changes

2 files changed, 18 insertions(+), 4 deletions(-)


Diff

diff --git a/electron/main.js b/electron/main.js
index 1f0f69fb..0526a8cd 100644
--- a/electron/main.js
+++ b/electron/main.js
@@ -108,9 +108,12 @@ function verifyBackendIntegrity(exeDir) {
const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
const issues = [];
+ const filesToVerify = manifest.files || manifest;
+ const metadata = manifest._metadata || {};
+
// The exeDir is build/exe when running or unpacked
// we only care about files in the manifest
- for (const [relPath, expectedHash] of Object.entries(manifest)) {
+ for (const [relPath, expectedHash] of Object.entries(filesToVerify)) {
const fullPath = path.join(exeDir, relPath);
if (!fs.existsSync(fullPath)) {
issues.push(`Missing: ${relPath}`);
@@ -124,6 +127,10 @@ function verifyBackendIntegrity(exeDir) {
}
}
+ if (issues.length > 0 && metadata.date && metadata.time) {
+ issues.unshift(`Backend build timestamp: ${metadata.date} ${metadata.time}`);
+ }
+
return {
ok: issues.length === 0,
issues: issues,

diff --git a/scripts/build-backend.js b/scripts/build-backend.js
index c6a9202b..a7b3e629 100755
--- a/scripts/build-backend.js
+++ b/scripts/build-backend.js
@@ -21,17 +21,24 @@ function getFiles(dir, fileList = []) {
function generateManifest(buildDir, manifestPath) {
console.log("Generating backend integrity manifest...");
const files = getFiles(buildDir);
- const manifest = {};
+ const manifest = {
+ _metadata: {
+ version: 1,
+ date: new Date().toISOString().split("T")[0],
+ time: new Date().toISOString().split("T")[1].split(".")[0],
+ },
+ files: {},
+ };
for (const file of files) {
const relativePath = path.relative(buildDir, file);
const fileBuffer = fs.readFileSync(file);
const hash = crypto.createHash("sha256").update(fileBuffer).digest("hex");
- manifest[relativePath] = hash;
+ manifest.files[relativePath] = hash;
}
fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2));
- console.log(`Manifest saved to ${manifestPath} (${Object.keys(manifest).length} files)`);
+ console.log(`Manifest saved to ${manifestPath} (${Object.keys(manifest.files).length} files)`);
}
try {


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────